package com.yh.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yh.bean.Category;
import com.yh.bean.OfficeObject;
import com.yh.bean.OfficeObjectApply;
import com.yh.dao.OfficeObjectDao;

@Service
public class OfficeObjectServiceImpl implements OfficeObjectService{

		@Autowired
		private OfficeObjectDao ood;
		
		//查询分类
		@Override
		public List<Category> querycategory() {
			// TODO Auto-generated method stub
			List<Category> ctlist=ood.querycategory();
			return ctlist;
		}
		
		//根据条件查询物品
		@Override
		public List<OfficeObject> queryoobycondition(OfficeObject oo) {
			// TODO Auto-generated method stub
			List<OfficeObject> oolist=ood.queryoobycondition(oo);
			return oolist;
		}
		
		//租用物品
		@Override
		public int rentoo(OfficeObjectApply ooa) {
			// TODO Auto-generated method stub
			int i=ood.rentoo(ooa);
			return i;
		}
		//库存减
		@Override
		public int substore(OfficeObjectApply ooa) {
			// TODO Auto-generated method stub
			int i=ood.substore(ooa);
			return i;
		}
		
		//库存加
		@Override
		public int addstore(OfficeObjectApply ooa){
			int i=ood.addstore(ooa);
			return i;
		};
		
		//查询租用物品
		@Override
		public List<OfficeObjectApply> sendoo(OfficeObjectApply ooa) {
			// TODO Auto-generated method stub
			List<OfficeObjectApply> ooalist=ood.sendoo(ooa);
			return ooalist;
		}
		
		//归还物品
		@Override
		public int sendofficeobject(OfficeObjectApply ooa){
			int i=ood.sendofficeobject(ooa);
			return i;
		}
		
		//库存减
		@Override
		public int delooa(){
			int i=ood.delooa(1);
			return i;
		}
		//根据条件查询借出物品
		@Override
		public List<OfficeObjectApply> queryooabycondition(OfficeObjectApply ooa) {
			// TODO Auto-generated method stub
			List<OfficeObjectApply> ooalist=ood.queryooabycondition(ooa);
			return ooalist;
		}
		//添加物品
		@Override
		public int insertoo(OfficeObject oo) {
			// TODO Auto-generated method stub
			int i=ood.insertoo(oo);
			return i;
		}
		//修改物品
		@Override
		public int updateoo(OfficeObject oo) {
			// TODO Auto-generated method stub
			int i=ood.updateoo(oo);
			return i;
		}
		
		//添加分类
		@Override
		public int insertcategory(Category ctg) {
			// TODO Auto-generated method stub
			int i=ood.insertcategory(ctg);
			return i;
		}
		
		//删除物品
		@Override
		public int deleteoo(int oo_id) {
			// TODO Auto-generated method stub
			int i=ood.deleteoo(oo_id);
			return i;
		};
}
